local wangzun = fk.CreateSkill{
  name = "mini__wangzun",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["mini__wangzun"] = "妄尊",
  [":mini__wangzun"] = "锁定技，其他角色的准备阶段，若其体力值大于你，你摸一张牌，然后若其体力值为全场唯一最大，其本回合手牌上限-1。",

  ["$mini__wangzun1"] = "如今天命归我，玉玺便是明证！",
  ["$mini__wangzun2"] = "哈哈哈哈哈哈哈，朕，今日便要登基为帝！",
}

wangzun:addEffect(fk.EventPhaseStart, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    return target.phase == Player.Start and player:hasSkill(wangzun.name) and target.hp > player.hp
  end,
  on_cost = function (self, event, target, player, data)
    event:setCostData(self, {tos = {target}})
    return true
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:drawCards(1, wangzun.name)
    if not target.dead and
      table.every(room:getOtherPlayers(target, false), function (p)
        return p.hp < target.hp
      end) then
      room:addPlayerMark(target, MarkEnum.MinusMaxCardsInTurn, 1)
    end
  end,
})

return wangzun
